package RentCarProject;

public class Car{
    int id;
    String name;
    String color;
    String type;
    boolean state;
    int rent;
    String renttime;
    String returntime;
    String addtime;
    int count=0;
    String renter;

    String picture;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean getState() {
        return state;
    }

    public void setState(Boolean state){
        this.state = state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public String getRenttime() {
        return renttime;
    }

    public void setRenttime(String renttime) {
        this.renttime = renttime;
    }

    public String getReturntime() {
        return returntime;
    }

    public void setReturntime(String returntime) {
        this.returntime = returntime;
    }

    public String getAddtime() {
        return addtime;
    }

    public void setAddtime(String addtime) {
        this.addtime = addtime;
    }

    public int getRent() {
        return rent;
    }

    public void setRent(int rent) {
        this.rent = rent;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getRenter() {
        return renter;
    }

    public void setRenter(String renter) {
        this.renter = renter;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    //    public boolean idSearch(int id) throws Exception {
//        Properties properties=new Properties();
//        properties.load(new FileInputStream("src/druid.properties"));
//        DataSource dataSource= DruidDataSourceFactory.createDataSource(properties);
//        Connection connection=dataSource.getConnection();
//        String sql="select * from car where id=? ";
//        PreparedStatement preparedStatement=connection.prepareStatement(sql);
//        preparedStatement.setInt(1,id);
//        ResultSet resultSet=preparedStatement.executeQuery();
//        if(resultSet.next()){
//
//        }
//    }

//    public boolean rentCar(int id) throws Exception {
//        Properties properties=new Properties();
//        properties.load(new FileInputStream("src/druid.properties"));
//        DataSource dataSource= DruidDataSourceFactory.createDataSource(properties);
//        Connection connection=dataSource.getConnection();
//        String sql="update car set type=0 where id=? ";
//        PreparedStatement preparedStatement=connection.prepareStatement(sql);
//        preparedStatement.setInt(1,id);
//        preparedStatement.executeUpdate();
//    }
}
